home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / a_utils / perl / perl5a1.lha / perl5alpha1 / do / seek < prev    next >
Encoding:
Text File  |  1992-08-15  |  455 b   |  30 lines

  1. bool
  2. do_seek(stab, pos, whence)
  3. STAB *stab;
  4. long pos;
  5. int whence;
  6. {
  7.     register STIO *stio;
  8.  
  9.     if (!stab)
  10.     goto nuts;
  11.  
  12.     stio = stab_io(stab);
  13.     if (!stio || !stio->ifp)
  14.     goto nuts;
  15.  
  16. #ifdef ULTRIX_STDIO_BOTCH
  17.     if (feof(stio->ifp))
  18.     (void)fseek (stio->ifp, 0L, 2);        /* ultrix 1.2 workaround */
  19. #endif
  20.  
  21.     return fseek(stio->ifp, pos, whence) >= 0;
  22.  
  23. nuts:
  24.     if (dowarn)
  25.     warn("seek() on unopened file");
  26.     errno = EBADF;
  27.     return FALSE;
  28. }
  29.  
  30.